package com.yunji.system.context;

import com.yunji.common.model.domain.SysRoleDO;
import com.yunji.common.model.dto.SysRoleDTO;
import com.yunji.system.mapper.ISysCommonMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author : peter-zhu
 * @date : 2024/12/30 21:32
 * @description : TODO
 **/
@Component
public class SysCommonService {
    private static ISysCommonMapper commonMapper;

    @Autowired
    protected void setSysCommonMapper(ISysCommonMapper commonMapper) {
        SysCommonService.commonMapper = commonMapper;
    }

    public static String getBelongName(Long belongId) {
        return commonMapper.getBelongName(belongId);
    }

    public static List<SysRoleDTO> getRoleListByUserId(Long userId) {
        return commonMapper.getRoleListByUserId(userId);
    }

}
